{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#\n",
    "#http://selenium-python.readthedocs.io\n",
    "\n",
    "#第一波\n",
    "#\n",
    "import selenium"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from selenium import webdriver\n",
    "from selenium.webdriver.common.keys import Keys"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "driver = webdriver.Chrome()\n",
    "driver.get(\"http://www.python.org\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "assert \"Python\" in driver.title"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Welcome to Python.org\n"
     ]
    }
   ],
   "source": [
    "print(driver.title)\n",
    "elem = driver.find_element_by_name(\"q\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "elem.clear()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "elem.send_keys(\"pycon\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "elem.send_keys(Keys.RETURN)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "assert \"No results found.\" not in driver.page_source"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "driver.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#\n",
    "#第二波\n",
    "#"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# import unittest\n",
    "# from selenium import webdriver\n",
    "# from selenium.webdriver.common.keys import Keys\n",
    "\n",
    "# class PythonOrgSearch(unittest.TestCase):\n",
    "\n",
    "#     def setUp(self):\n",
    "#         self.driver = webdriver.Firefox()\n",
    "\n",
    "#     def test_search_in_python_org(self):\n",
    "#         driver = self.driver\n",
    "#         driver.get(\"http://www.python.org\")\n",
    "#         self.assertIn(\"Python\", driver.title)\n",
    "#         elem = driver.find_element_by_name(\"q\")\n",
    "#         elem.send_keys(\"pycon\")\n",
    "#         elem.send_keys(Keys.RETURN)\n",
    "#         assert \"No results found.\" not in driver.page_source\n",
    "\n",
    "\n",
    "#     def tearDown(self):\n",
    "#         self.driver.close()\n",
    "\n",
    "# if __name__ == \"__main__\":\n",
    "#     unittest.main()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "ename": "NoAlertPresentException",
     "evalue": "Message: no alert open\n  (Session info: chrome=65.0.3325.181)\n  (Driver info: chromedriver=2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Windows NT 10.0.16299 x86_64)\n",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNoAlertPresentException\u001b[0m                   Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-36-6d6b44314438>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0mdriver\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mwebdriver\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mChrome\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0malert\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mdriver\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mswitch_to_alert\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32mE:\\Anaconda3\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py\u001b[0m in \u001b[0;36mswitch_to_alert\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m    785\u001b[0m         \"\"\"\n\u001b[1;32m    786\u001b[0m         \u001b[0mwarnings\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwarn\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"use driver.switch_to.alert instead\"\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mDeprecationWarning\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m--> 787\u001b[0;31m         \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_switch_to\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0malert\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    788\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m    789\u001b[0m     \u001b[1;31m# Navigation\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[0;32mE:\\Anaconda3\\lib\\site-packages\\selenium\\webdriver\\remote\\switch_to.py\u001b[0m in \u001b[0;36malert\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m     53\u001b[0m         \"\"\"\n\u001b[1;32m     54\u001b[0m         \u001b[0malert\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mAlert\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_driver\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m---> 55\u001b[0;31m         \u001b[0malert\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtext\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     56\u001b[0m         \u001b[1;32mreturn\u001b[0m \u001b[0malert\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m     57\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[0;32mE:\\Anaconda3\\lib\\site-packages\\selenium\\webdriver\\common\\alert.py\u001b[0m in \u001b[0;36mtext\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m     67\u001b[0m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdriver\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexecute\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mCommand\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mW3C_GET_ALERT_TEXT\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"value\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m     68\u001b[0m         \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m---> 69\u001b[0;31m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdriver\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexecute\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mCommand\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mGET_ALERT_TEXT\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"value\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     70\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m     71\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0mdismiss\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[0;32mE:\\Anaconda3\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py\u001b[0m in \u001b[0;36mexecute\u001b[0;34m(self, driver_command, params)\u001b[0m\n\u001b[1;32m    310\u001b[0m         \u001b[0mresponse\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcommand_executor\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexecute\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdriver_command\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mparams\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m    311\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mresponse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m--> 312\u001b[0;31m             \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0merror_handler\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcheck_response\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mresponse\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    313\u001b[0m             response['value'] = self._unwrap_value(\n\u001b[1;32m    314\u001b[0m                 response.get('value', None))\n",
      "\u001b[0;32mE:\\Anaconda3\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py\u001b[0m in \u001b[0;36mcheck_response\u001b[0;34m(self, response)\u001b[0m\n\u001b[1;32m    240\u001b[0m                 \u001b[0malert_text\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'alert'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'text'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m    241\u001b[0m             \u001b[1;32mraise\u001b[0m \u001b[0mexception_class\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mmessage\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mscreen\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstacktrace\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0malert_text\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m--> 242\u001b[0;31m         \u001b[1;32mraise\u001b[0m \u001b[0mexception_class\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mmessage\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mscreen\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstacktrace\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    243\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m    244\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0m_value_or_default\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mobj\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdefault\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mNoAlertPresentException\u001b[0m: Message: no alert open\n  (Session info: chrome=65.0.3325.181)\n  (Driver info: chromedriver=2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7),platform=Windows NT 10.0.16299 x86_64)\n"
     ]
    }
   ],
   "source": [
    "driver=webdriver.Chrome()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "driver.get(\"http://www.python.org\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "driver.back()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "driver.forward()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "driver.get(\"https://www.jianshu.com/\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'domain': '.jianshu.com',\n",
       "  'expiry': 7829006495,\n",
       "  'httpOnly': False,\n",
       "  'name': 'sensorsdata2015jssdkcross',\n",
       "  'path': '/',\n",
       "  'secure': False,\n",
       "  'value': '%7B%22distinct_id%22%3A%2216252bc4e875e0-01d1ae8079ea19-b34356b-2073600-16252bc4e88c5%22%2C%22%24device_id%22%3A%2216252bc4e875e0-01d1ae8079ea19-b34356b-2073600-16252bc4e88c5%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_referrer%22%3A%22%22%2C%22%24latest_referrer_host%22%3A%22%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%7D%7D'},\n",
       " {'domain': 'www.jianshu.com',\n",
       "  'httpOnly': False,\n",
       "  'name': 'signin_redirect',\n",
       "  'path': '/',\n",
       "  'secure': False,\n",
       "  'value': 'https%3A%2F%2Fwww.jianshu.com%2F'},\n",
       " {'domain': 'www.jianshu.com',\n",
       "  'httpOnly': False,\n",
       "  'name': 'read_mode',\n",
       "  'path': '/',\n",
       "  'secure': False,\n",
       "  'value': 'day'},\n",
       " {'domain': 'www.jianshu.com',\n",
       "  'httpOnly': False,\n",
       "  'name': 'default_font',\n",
       "  'path': '/',\n",
       "  'secure': False,\n",
       "  'value': 'font2'},\n",
       " {'domain': 'www.jianshu.com',\n",
       "  'httpOnly': False,\n",
       "  'name': 'locale',\n",
       "  'path': '/',\n",
       "  'secure': False,\n",
       "  'value': 'zh-CN'},\n",
       " {'domain': '.jianshu.com',\n",
       "  'expiry': 1553342495,\n",
       "  'httpOnly': False,\n",
       "  'name': 'Hm_lvt_0c0e9d9b1e7d617b3e6842e85b9fb068',\n",
       "  'path': '/',\n",
       "  'secure': False,\n",
       "  'value': '1521806495'},\n",
       " {'domain': '.jianshu.com',\n",
       "  'httpOnly': False,\n",
       "  'name': 'Hm_lpvt_0c0e9d9b1e7d617b3e6842e85b9fb068',\n",
       "  'path': '/',\n",
       "  'secure': False,\n",
       "  'value': '1521806495'},\n",
       " {'domain': '.jianshu.com',\n",
       "  'expiry': 1521820799,\n",
       "  'httpOnly': False,\n",
       "  'name': 'sajssdk_2015_cross_new_user',\n",
       "  'path': '/',\n",
       "  'secure': False,\n",
       "  'value': '1'}]"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "driver.get_cookies()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\\nThese are the two private methods: \\nfind_element\\nfind_elements.\\n\\n\\nfrom selenium.webdriver.common.by import By\\n\\ndriver.find_element(By.XPATH, \\'//button[text()=\"Some text\"]\\')\\ndriver.find_elements(By.XPATH, \\'//button\\')\\n\\nBy.\\nID = \"id\"\\nXPATH = \"xpath\"\\nLINK_TEXT = \"link text\"\\nPARTIAL_LINK_TEXT = \"partial link text\"\\nNAME = \"name\"\\nTAG_NAME = \"tag name\"\\nCLASS_NAME = \"class name\"\\nCSS_SELECTOR = \"css selector\"\\n\\n'"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''\n",
    "find_element_by_id\n",
    "find_element_by_name\n",
    "find_element_by_xpath\n",
    "find_element_by_link_text\n",
    "find_element_by_partial_link_text\n",
    "find_element_by_tag_name\n",
    "find_element_by_class_name\n",
    "find_element_by_css_selector\n",
    "'''\n",
    "\n",
    "'''\n",
    "多个元素\n",
    "\n",
    "find_elements_by_name\n",
    "find_elements_by_xpath\n",
    "find_elements_by_link_text\n",
    "find_elements_by_partial_link_text\n",
    "find_elements_by_tag_name\n",
    "find_elements_by_class_name\n",
    "find_elements_by_css_selector\n",
    "'''\n",
    "\n",
    "'''\n",
    "These are the two private methods: \n",
    "find_element\n",
    "find_elements.\n",
    "\n",
    "\n",
    "from selenium.webdriver.common.by import By\n",
    "\n",
    "driver.find_element(By.XPATH, '//button[text()=\"Some text\"]')\n",
    "driver.find_elements(By.XPATH, '//button')\n",
    "\n",
    "By.\n",
    "ID = \"id\"\n",
    "XPATH = \"xpath\"\n",
    "LINK_TEXT = \"link text\"\n",
    "PARTIAL_LINK_TEXT = \"partial link text\"\n",
    "NAME = \"name\"\n",
    "TAG_NAME = \"tag name\"\n",
    "CLASS_NAME = \"class name\"\n",
    "CSS_SELECTOR = \"css selector\"\n",
    "\n",
    "'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'\\nimport unittest\\nfrom selenium import webdriver\\nimport page\\n\\nclass PythonOrgSearch(unittest.TestCase):\\n    \"\"\"A sample test class to show how page object works\"\"\"\\n\\n    def setUp(self):\\n        self.driver = webdriver.Firefox()\\n        self.driver.get(\"http://www.python.org\")\\n\\n    def test_search_in_python_org(self):\\n        \"\"\"\\n        Tests python.org search feature. Searches for the word \"pycon\" then verified that some results show up.\\n        Note that it does not look for any particular text in search results page. This test verifies that\\n        the results were not empty.\\n        \"\"\"\\n\\n        #Load the main page. In this case the home page of Python.org.\\n        main_page = page.MainPage(self.driver)\\n        #Checks if the word \"Python\" is in title\\n        assert main_page.is_title_matches(), \"python.org title doesn\\'t match.\"\\n        #Sets the text of search textbox to \"pycon\"\\n        main_page.search_text_element = \"pycon\"\\n        main_page.click_go_button()\\n        search_results_page = page.SearchResultsPage(self.driver)\\n        #Verifies that the results page is not empty\\n        assert search_results_page.is_results_found(), \"No results found.\"\\n\\n    def tearDown(self):\\n        self.driver.close()\\n\\nif __name__ == \"__main__\":\\n    unittest.main()\\n\\n'"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''\n",
    "import unittest\n",
    "from selenium import webdriver\n",
    "import page\n",
    "\n",
    "class PythonOrgSearch(unittest.TestCase):\n",
    "    \"\"\"A sample test class to show how page object works\"\"\"\n",
    "\n",
    "    def setUp(self):\n",
    "        self.driver = webdriver.Firefox()\n",
    "        self.driver.get(\"http://www.python.org\")\n",
    "\n",
    "    def test_search_in_python_org(self):\n",
    "        \"\"\"\n",
    "        Tests python.org search feature. Searches for the word \"pycon\" then verified that some results show up.\n",
    "        Note that it does not look for any particular text in search results page. This test verifies that\n",
    "        the results were not empty.\n",
    "        \"\"\"\n",
    "\n",
    "        #Load the main page. In this case the home page of Python.org.\n",
    "        main_page = page.MainPage(self.driver)\n",
    "        #Checks if the word \"Python\" is in title\n",
    "        assert main_page.is_title_matches(), \"python.org title doesn't match.\"\n",
    "        #Sets the text of search textbox to \"pycon\"\n",
    "        main_page.search_text_element = \"pycon\"\n",
    "        main_page.click_go_button()\n",
    "        search_results_page = page.SearchResultsPage(self.driver)\n",
    "        #Verifies that the results page is not empty\n",
    "        assert search_results_page.is_results_found(), \"No results found.\"\n",
    "\n",
    "    def tearDown(self):\n",
    "        self.driver.close()\n",
    "\n",
    "if __name__ == \"__main__\":\n",
    "    unittest.main()\n",
    "\n",
    "'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
